package mytree;

/**
 * Created by Administrator on 2017/4/27.
 */
public class Mytree<E> {
    private E data;//数据本身
    private Mytree<E> lChild;//左子数
    private Mytree<E> rChild;//右字数

    public Mytree() {
    }

    public Mytree(E data, Mytree<E> lChild, Mytree<E> rChild) {
        this.data = data;
        this.lChild = lChild;
        this.rChild = rChild;
    }
    public Mytree(E data) {
        this.data = data;
        this.lChild = null;
        this.rChild = null;
    }
//针对当前的结点进行查找或更改
    public E getData() {
        return data;
    }

    public void setData(E data) {
        this.data = data;
    }

    public Mytree<E> getlChild() {
        return lChild;
    }

    public void setlChild(Mytree<E> lChild) {
        this.lChild = lChild;
    }

    public Mytree<E> getrChild() {
        return rChild;
    }

    public void setrChild(Mytree<E> rChild) {
        this.rChild = rChild;
    }
}
